<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <div
      :class="{ 'content-center': !props.info.subTitle && !props.info.remarks && !props.info.value }"
      class="content outline-parent-bg" 
      :style="{
        backgroundImage: `url(${publicUrls + 'free/style5/Level1outlineStyle6Bg.webp'})`,
      }"
    >
      <div class="Showroom-parent" v-if="props.info.digitalShowroom">
        <digitalShowroomIcon :url="props.info.digitalShowroom" :id="props.info.id" />
      </div>
      <div
        class="title-box"
        :class="{
          'title-box-2': !props.info.subTitle && props.info.remarks && !props.info.value,
          'title-box-3': !props.info.subTitle && !props.info.remarks && props.info.value,
        }"
      >
        <p>{{ props.info.text }}</p>
      </div>
      <p class="subtitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>

      <div
        class="img-box"
        :class="{
          'img-box1': props.info.remarks && props.info.subTitle,
          'img-box2': props.info.remarks && !props.info.subTitle,
          'img-box3': !props.info.remarks && !props.info.subTitle,
          'img-box4': !props.info.remarks && props.info.subTitle,
        }"
        v-if="props.info.value"
      >
        <div class="outline-cover">
          <img
          
          @click="ImgVisible = true"
          :src="urls + props.info.value + '?imageView2/3/format/webp'"
          alt=""
        />
        </div>
      </div>
      <div class="remarks1" v-if="props.info.value">
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="getRemarksNum(7, route.meta.loopType)"
        ></TextMax>
      </div>
      <div
        class="remarks2"
        :class="{
          remarks3: !props.info.subTitle,
        }"
        v-else-if="props.info.remarks"
      >
        <TextMax
          :infoData="props.info"
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="getRemarksNum(18, route.meta.loopType)"
        ></TextMax>
      </div>
    </div>
  </div>
</template>  

<script lang="ts">
export default defineComponent({
  name: 'free3Style1',
});
</script>  
  
<script setup lang="ts">
import { getRemarksNum } from '@/utils/minxin';
import digitalShowroomIcon from '@/freeComponents/unitdigitalShowroom/style5.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml, textType } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { computed, defineComponent, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax5.vue';
import { useProjectStore } from '@/store';
import { useRouter, useRoute } from 'vue-router';
const route = useRoute();
const ImgVisible = ref(false);
const store = useProjectStore();
const title = ref();

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});

// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-right: 200px;
  // margin-left: 120px;
  margin-top: 0;
}
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 620px;
  height: 100%;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  // box-shadow: 8px 6px 4px 0px rgba(2, 2, 2, 0.1);
  padding: 99px 217px 0px;
  padding-right: 50px;
}
.content-center {
  justify-content: center;
}
.Showroom-parent { 
  display: flex;
  position: absolute;
  top: 25px;
  left: 160px;
  z-index: 15;
  width: 50px;
  height: 50px;
}
.title-box {
  display: flex;
  align-items: center;
  width: 100%;
  :deep(p) {
    width: 100%;
    font-family: SourceBold;
    font-size: 32px;
    color: rgba(63, 95, 92, 1);
    line-height: 48px;
    text-align: center;
  }
}
.title-box-2 {
}
.title-box-3 {
  margin-top: 46px;
  height: 96px;
}
.title-box-4 {
}

.subtitle {
  width: 100%;
  font-family: SourceMedium;
  font-size: 18px;
  color: rgba(63, 95, 92, 1);
  line-height: 28px;
  text-align: center;
  margin-top: 10px;
  font-weight: 400;
}

.img-box {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(106, 168, 179, 0.2);
  border: 5px solid rgba(106, 168, 179, 0.13);
  // border-radius: 8px;
  margin-top: 20px;
  .outline-cover {
    width: 100%;
    height: 100%; 
    object-fit: contain;
    overflow: hidden;
    img { 
      transition: all 0.3s; 
      width: 100%;
      height: 100%; 
      object-fit: contain;
    }
  }
}
.img-box:hover {
  .outline-cover {
    img {
      transform: scale(1.3);
    }
  }
}
.img-box1 {
  width: 353px; 
  height: 319px; 
  margin-top: 20px;
}
.img-box2 {
  width: 353px;
  height: 395px;
  margin-top: 10px;
}
.img-box3 {
  width: 353px;
  height: 518px;
  margin-top: 30px;
}
.img-box4 {
  width: 353px;
  height: 518px;
  margin-top: 20px;
}
// .outline-cover {
//   height: 180px; 
//   width: auto;
//   max-width: 320px;
//   object-fit: contain;
//   transition: all 0.3s;
// }
.outline-cover:hover {
  // transform: scale(1.2);
}

.remarks1 {
  width: 100%;
  margin-top: 20px; 
}
.remarks2 { 
  width: 100%;
  margin-top: 10px;
}
.remarks3{
  margin-top: 20px;
}
</style>
